package net.slteam.base;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.filter.SimplePropertyPreFilter;

/**
 * @author calm
 */
public interface IError {
    public static final String DOMAIN_SLTEAM = "net.slteam";

    Integer getCode();
    String getMessage();

    default String getDomain() {
        return DOMAIN_SLTEAM;
    };

    default String toJSONString() {
        SimplePropertyPreFilter f = new SimplePropertyPreFilter("domain", "code", "message");
        return JSON.toJSONString(this, f);
    }
}
